package com.aryankh.controller;

import com.aryankh.core.RedisTemplate;
import com.fasterxml.jackson.core.type.TypeReference;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @version 1.0
 * @Author AryanKH
 * @Date 2022/5/26 11:01
 * @Default
 */
@Slf4j
@RestController
//@CrossOrigin
public class TestController  {
    @Resource
    RedisTemplate redisTemplate;

    @GetMapping("test")
    public String test(){
        redisTemplate.setObject("map", List.of("kh","233"),-1L);
        List<String> map = redisTemplate.getObject("map", new TypeReference<List<String>>(){});
        log.info(map.toString());
        return "Hello ssm-pro";
    }
}
